-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Excel format support #156
Conversation
Code Climate has analyzed commit 44ed13b and detected 0 issues on this pull request. View more on Code Climate. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋
thanks for making this change, really cool. I've left couple of comments about it, otherwise it's ok.
|
||
// Set the column headers | ||
file.SetCellValue(sheetName, "A1", "IP/Host") | ||
file.SetCellValue(sheetName, "B1", "Servicios") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Services?
} | ||
|
||
// Save the Excel file | ||
err = file.SaveAs("nmap-output.xlsx") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a Writer that we use for output (by default it's stdout), I think we can use this https://xuri.me/excelize/en/utils.html#FileWriter
file.Write(f.config.Writer, /* some opts */)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about the options though
``` | ||
|
||
All other options can be found on [Installation Wiki page](https://github.com/vdjagilev/nmap-formatter/wiki/Installation). | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔 I think people should be able to visit the wiki installation just by clicking, not sure why we are removing this.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #156 +/- ##
==========================================
- Coverage 81.79% 77.74% -4.05%
==========================================
Files 20 21 +1
Lines 692 728 +36
==========================================
Hits 566 566
- Misses 79 115 +36
Partials 47 47 ☔ View full report in Codecov by Sentry. |
Linter also reported some issues here: https://github.com/vdjagilev/nmap-formatter/pull/156/files#annotation_17863585109 |
I will merge it into development branch, there I can add some more unit tests and fix linter mistakes |
77d8074
into
vdjagilev:feat/excel-support
* Add Excel format support (#156) * Excel format support added * fix issuses * Update README.md * Update README.md * Update README.md * Update README.md * tweak: ci: fix branch trigger name * tweak: err check * chore: refactor writing headers * chore: minor warning fixes * chore: ci: update versions * refactor: split into smaller functions * tweak: excel: column width * tweak: excel: cosmetic text wrapping * tweak: excel: ip-addr & hostname text cosmetic improvements * tests: implement basic unit tests * tweak: linter fixes * tests: increase validation coverage * tests: coverage: output file * tests: excel: more test cases * tests: excel: bigger coverage --------- Co-authored-by: Gorka <72318822+gorkavp@users.noreply.github.com>
* Add Excel format support (#156) * Excel format support added * fix issuses * Update README.md * Update README.md * Update README.md * Update README.md * tweak: ci: fix branch trigger name * tweak: err check * chore: refactor writing headers * chore: minor warning fixes * chore: ci: update versions * refactor: split into smaller functions * tweak: excel: column width * tweak: excel: cosmetic text wrapping * tweak: excel: ip-addr & hostname text cosmetic improvements * tests: implement basic unit tests * tweak: linter fixes * tests: increase validation coverage * tests: coverage: output file * tests: excel: more test cases * tests: excel: bigger coverage --------- Co-authored-by: Gorka <72318822+gorkavp@users.noreply.github.com>
This pull request adds support for generating Excel files as an output format in addition to the existing formats (html, csv, md, json, dot, sqlite). The changes include adding a new ExcelOutput constant, updating the OutputOptions struct to include ExcelOptions, and implementing the ExcelFormatter struct and its methods for formatting the data into an Excel file.